home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Explosion
/
Software Explosion (Fore-Matt Home Computing)(1996).iso
/
games
/
workbench
/
lander_2
/
source
/
rocketaudio.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-01
|
2KB
|
110 lines
#include <exec/types.h>
#include <exec/memory.h>
#include <exec/interrupts.h>
#include "sample.h"
#include "sounds.h"
#include "flame.h"
#define MAXSOUNDS 9
extern Sound eagle1sound, eagle2sound, lcrashsound, rcrashsound, saucersound,
lxthrustsound, rxthrustsound, lythrustsound, rythrustsound;
GLOBAL Sound *sounds[MAXSOUNDS] = {&eagle1sound, &eagle2sound, &lcrashsound,
&rcrashsound, &saucersound, &lxthrustsound, &rxthrustsound,
&lythrustsound, &rythrustsound};
GLOBAL int maxsounds = MAXSOUNDS;
extern int debug;
RocketAudioQuit()
{
endaudio();
}
RocketAudioInit()
{
initaudio();
add_cleanup(RocketAudioQuit, "rocket audio");
}
Eagle1Done()
{
StopSound(&eagle1sound);
PlaySound(&eagle2sound);
}
Eagle2Done()
{
StopSound(&eagle2sound);
}
LandedAudio()
{
SaucerQuiet();
PlaySound(&eagle1sound);
/* WaitSound(&eagle1sound);
PlaySound(&eagle2sound);
WaitSound(&eagle2sound); */
}
CrashAudio()
{
ThrustQuiet(LEFTFLAME|RIGHTFLAME|MAINFLAME);
SaucerQuiet();
PlaySound(&lcrashsound);
PlaySound(&rcrashsound);
}
CrashQuiet()
{
WaitSound(&lcrashsound);
WaitSound(&rcrashsound);
}
PlaySaucer()
{
PlaySound(&saucersound);
}
SaucerQuiet()
{
StopSound(&saucersound);
}
ThrustAudio(i)
int i;
{
switch (i)
{
case LEFTFLAME:
PlaySound(&lxthrustsound);
break;
case RIGHTFLAME:
PlaySound(&rxthrustsound);
break;
case MAINFLAME:
PlaySound(&lythrustsound);
PlaySound(&rythrustsound);
break;
}
}
ThrustQuiet(i)
int i;
{
if (i & LEFTFLAME)
StopSound(&lxthrustsound);
if (i & RIGHTFLAME)
StopSound(&rxthrustsound);
if (i & MAINFLAME)
{
StopSound(&lythrustsound);
StopSound(&rythrustsound);
}
}